Page({
  data: {
    appliedMajor: '',
    preferredCollege: '',
    foreignLanguage: '',
    examLocation: ''
  },
  handleInput(e) {
    const field = e.currentTarget.dataset.field;
    this.setData({ [field]: e.detail.value });
  },
  submitForm() {
    const exam_candidate_info = wx.getStorageInfoSync('exam_candidate_info');
    Object.assign(exam_candidate_info, {
      appliedMajor: this.data.appliedMajor,
    preferredCollege: this.data.preferredCollege,
    foreignLanguage: this.data.foreignLanguage,
    examLocation: this.data.examLocation
    });
    wx.setStorageSync('exam_candidate_info', exam_candidate_info)
    console.log("123")
    console.log(exam_candidate_info)
    // 表单提交逻辑，可以发送到服务器或本地存储
    wx.showToast({
      title: '报名信息提交成功',
      icon: 'success',
      duration: 2000
    });
  }
});